#!/usr/bin/env python
# encoding: utf-8
import django.newforms as forms
from models import Post,Catalog

class addBlogPost(forms.Form): 
    title = forms.CharField(label='标题',required=True)
    content = forms.CharField(label='内容',widget = forms.Textarea(attrs={'rows': 10, 'cols': 50}))
    resdate = forms.DateTimeField(label='发布日期')
    restype = forms.ChoiceField(label='类别',choices=[(c.id,c.catalog_name) for c in Catalog.objects.all()])